home *** CD-ROM | disk | FTP | other *** search
- -- background: 6089 from stack: in
- -- bmap block id: 6712
- -- flags: 0000
- -- background id: 0
- -- name: Graph
- ----- HyperTalk script -----
- on openCard
- push recent card
- pass openCard
- end opencard
-
- on closeCard
- repeat with i=1 to the number of bkgnd buttons
- set hilite of bkgnd button i to false
- end repeat
- pass closeCard
- end closecard
-
- on clearScreen
- choose select tool
- doMenu select all
- doMenu clear picture
- repeat with i=1 to the number of bkgnd buttons
- set hilite of bkgnd button i to false
- end repeat
- end clearScreen
-
- function frheight
- return 260
- end frameheight
-
- function framewidth
- return 310
- end framewidth
-
- function framebottom
- return 280
- end framebottom
-
- function frameleft
- return 105
- end frameleft
-
- function maxline what
- put 0 into result
- repeat with i = 1 to the number of lines in what
- put max(line i of what,result) into result
- end repeat
- return result
- end maxLine
-
- on drawframe drawX
- global y2ofs
- reset paint
- choose text tool
- set the textFont to Geneva
- set textSize to 9
- set textAlign to Center
- put the number of lines in field "X" into datacount
- put frameleft() into horiz
- put round(framewidth()/(dataCount-1)) into XStep
- choose line tool
- drag from frameleft(),framebottom()-frheight() to frameleft(),framebottom()
- repeat with i = 1 to dataCount
- get line i of field "X"
- if drawX and ((Xstep > 12) or ( i mod 2 = 1)) then
- choose text tool
- click at horiz,framebottom()+30
- type it
- doMenu Select
- doMenu rotate right
- choose line tool
- drag from horiz,framebottom()+3 to horiz,framebottom()
- end if
- add XStep to horiz
- end repeat
- choose line tool
- subtract XStep from horiz
- put horiz into y2ofs
- drag from frameleft(),framebottom() to horiz,framebottom()
- drag from horiz,framebottom()-frheight() to horiz,framebottom()
- reset paint
- choose browse tool
- end drawframe
-
- on drawY fld, algn, xpos
- reset paint
- choose text tool
- set the textFont to Geneva
- set textSize to 9
- set textHeight to 9
- set textAlign to algn
- put maxLine (field fld) into maxY
- if maxY < 18 then put maxY into incr else put 18 into incr
- put the number of lines in field fld into datacount
- put round(frheight()/incr) into Y1Step
- put framebottom() into vert
- repeat with i = 0 to incr
- choose text tool
- put round(maxY/incr*i) into ndx
- put round(frheight()* ndx / maxY) into height1
- -- put round((frheight()/incr*i ) into height1
- -- click at xpos,vert
- click at xpos,framebottom()-height1
- if algn = "left" then type "_"
- type round(maxY/incr*i)
- if algn = "right" then type "_"
- subtract Y1Step from vert
- end repeat
- choose browse tool
- end drawY
-
- on getData src,bkg,dst
- put "" into field dst
- if (the number of cards in background bkg) < 3 then
- answer "No data! Use Load Data first." with "OK"
- put "0" & return & "1" into field dst
- else
- repeat with i = 2 to the number of cards in background bkg
- set the cursor to busy
- put (field src of card i of background bkg) & return after field dst
- end repeat
- end if
- end getData
-
- on drawgraph fld,pat,sclfld
- reset paint
- choose line tool
- set lineSize to 2
- set pattern to pat
- put maxLine (field sclfld) into maxY
- put the number of lines in field fld into datacount
- put round(framewidth()/dataCount) into Y1Step
- put frameleft() into horiz
- put round(framewidth()/(dataCount-1)) into XStep
- get line 1 of field fld
- if it is not empty then
- put round(frheight() * it / maxY) into height1
- repeat with i = 2 to dataCount
- get line i of field fld
- if it is not empty then
- put round(frheight() * it / maxY) into height
- drag from horiz,framebottom()-height1 to horiz+XStep,framebottom()-height with OptionKey
- put height into height1
- end if
- add XStep to horiz
- end repeat
- end if
- reset paint
- choose browse tool
- end drawgraph
-
- function nxtpat
- global lstpat
- if lstpat = 12
- then
- return 22
- else
- if lstpat = 22 then
- return 20
- else
- if lstpat = 20 then
- return 13
- else
- if lstpat = 13 then
- return 3
- else
- return 30
- end if
- end if
- end if
- end if
- end nxtpat
-
- on doLegend pat
- reset paint
- if pat = 12 then put 27 into yofs
- if pat = 22 then put 49 into yofs
- if pat = 20 then put 71 into yofs
- if pat = 13 then put 93 into yofs
- if pat = 3 then put 115 into yofs
- if pat = 30 then put 137 into yofs
- choose text tool
- set textAlign to center
- set textSize to 12
- set textFont to Chicago
- click at 35,yofs
- type the short name of the target
- choose line tool
- set lineSize to 2
- set pattern to pat
- drag from 15,yofs+5 to 55,yofs+5 with optionKey
- choose browse tool
- end doLegend
-
- on graphY1 fld
- global lstpat, newdata
- put 12 into lstpat
- if newdata then
- getdata "X_fld",the short name of this card,"X"
- clearscreen
- drawframe true
- put "false" into newdata
- else
- send mouseUp to bkgnd button "Clear"
- end if
- getdata fld,the short name of this card,"Y1"
- drawY "Y1",right,frameleft()-1
- drawgraph "Y1",12,"Y1"
- set hilite of the target to true
- doLegend lstpat
- end graphY1
-
- on graphY2 fld
- global lstpat, y2ofs
- put the optionkey is down into opt
- if y2ofs = 0 then put frameleft()+FrameWidth()+5 into y2ofs
- put nxtpat() into lstpat
- if opt then
- getdata fld,the short name of this card,"Y2"
- drawY "Y2",left,y2ofs+2
- drawgraph "Y2",lstpat,"Y2"
- else
- getdata fld,the short name of this card,"Y2"
- if (lstpat = 12) OR (lstpat = 22) then
- drawY "Y1",left,y2ofs+2
- end if
- drawgraph "Y2",lstpat,"Y1"
- end if
- set hilite of the target to true
- doLegend lstpat
- end graphY2
-
-
-
- -- part 2 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=150 right=169 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Logins
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 4 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=172 right=191 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Usage
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 5 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=194 right=213 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Pub
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 6 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=238 right=257 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: DL
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 7 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=216 right=235 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Pri
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 8 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=6 top=260 right=279 bottom=69
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: UL
- ----- HyperTalk script -----
- on mouseUp
- graphY1(the short name of the target)
- end mouseUp
-
-
-
- -- part 9 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=150 right=169 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Logins
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 10 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=172 right=191 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Usage
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 11 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=194 right=213 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Pub
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 12 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=216 right=235 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Pri
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 13 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=238 right=257 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: DL
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 14 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=445 top=260 right=279 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: UL
- ----- HyperTalk script -----
- on mouseUp
- graphY2(the short name of the target)
- end mouseUp
-
-
-
- -- part 15 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=0 top=324 right=342 bottom=19
- -- title width / last selected line: 0
- -- icon id / first selected line: 1015 / 1015
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name:
- ----- HyperTalk script -----
- on mouseUp
- global y2ofs
- if the optionkey is not down then
- repeat with i = 1 to 3
- set visible of field i to not visible of field i
- end repeat
- else
- drawY "Y1",right,frameleft()-1
- drawY "Y2",left,y2ofs+2
- drawgraph "Y1",12,"Y1"
- drawgraph "Y2",22,"Y2"
- end if
- end mouseUp
-
-
-
- -- part 16 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=459 top=7 right=32 bottom=497
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Clear
- ----- HyperTalk script -----
- on mouseUp
- global y2ofs
- put the optionkey is down into opt
- if opt then
- clearscreen
- else
- choose select tool
- -- drag from frameleft()+1,framebottom()-1 -- to y2ofs-1,0
- -- doMenu Clear Picture
- -- drag from frameleft()-1,framebottom() -- to frameleft()-38,0
- -- doMenu Clear Picture
- -- drag from y2ofs+1,framebottom() -- to y2ofs+38,0
- -- doMenu Clear Picture
- -- drag from 0,0 to 75,150
- drag from 1,framebottom()-1 to 512,0
- doMenu Clear Picture
- end if
- drawframe opt
- choose browse tool
- repeat with i = 1 to the number of bkgnd buttons
- set hilite of bkgnd button i to false
- end repeat
- end mouseUp
-
-
-
- -- part 25 (button)
- -- low flags: 00
- -- high flags: 8003
- -- rect: left=459 top=80 right=105 bottom=497
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Copy
- ----- HyperTalk script -----
- on mouseUp
- choose select tool
- doMenu select all
- doMenu copy picture
- choose browse tool
- end mouseUp
-
-
-
- -- part 24 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=463 top=40 right=70 bottom=497
- -- title width / last selected line: 0
- -- icon id / first selected line: 25002 / 25002
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Help
- ----- HyperTalk script -----
- on mouseUp
- push card
- go to first card of this background
- show card field "help"
- end mouseUp
-
-
-
- -- part 17 (field)
- -- low flags: 80
- -- high flags: 4007
- -- rect: left=6 top=8 right=147 bottom=67
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: Y1
-
-
- -- part 18 (field)
- -- low flags: 80
- -- high flags: 4007
- -- rect: left=446 top=8 right=147 bottom=507
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: Y2
-
-
- -- part 19 (field)
- -- low flags: 80
- -- high flags: 4007
- -- rect: left=18 top=283 right=342 bottom=89
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: X
-